<!DOCTYPE HTML>
<html>
<HEAD>
<meta charset="UTF-8">
<TITLE>回复详细信息</TITLE>
</HEAD>
 
<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

include_once('../DB.php');
$DB =  new DB();

//查询转盘信息
$res_list = $DB->get_all("select * from reply");

//获取操作信息
$action=$_GET["action"];
//是否删除
if($action=="del")
{
    //获取ID号
    $id=intval($_GET["id"]);
    //获取当前时间
    //$nowtime=date("Y/m/d H:i:s",time());
    $DB->delete("reply","id =  {$id}");
	//$mysql->runSql("update class set status=0,edittime='$nowtime' where class_id=$class_id");    
   echo "<script>alert('操作成功！');location='reply_list.php';</Script>";
   exit;    
}  
?>


<b>回复详细信息</b>
<table border=1>
        <tr>
            <td>序号</td><td>关键字</td><td>回复内容</td><td>回复图片</td>
            <td>回复链接</td><td>回复添加时间</td><td>回复修改时间</td>
            <td>回复结束时间</td><td>回复状态</td><td>回复类型</td>
            <td>删除</td><td>修改</td>
        </tr>
        <?php
            if($res_list)
            {
                foreach($res_list as $value)
                {
                
                    echo "<tr>
                          <td>$value[id]</td>
                          <td>$value[reply_key]</td>
                          <td>$value[reply_value]</td>
                          <td><img src='{$value[pic]}'width='50px' height='50px'></td>
                          <td><a href='{$value[link]}'>$value[link]</a></td>
                          <td>$value[addTime]</td>
                          <td>$value[editTime]</td>
                          <td>$value[endTime]</td>
                          <td>$value[re_status]</td>
                          <td>$value[type]</td>
                         
                              
                          <td><a href='reply_list.php?action=del&id=$value[id]'>删除</a></td>
                          <td><a href='reply_add.php?action=update&id=$value[id]'>修改</a></td>
                                              
                          <tr>";
                }
            }
			else
            {
			
                echo "<tr><td colspan=4>无记录</td></tr>";
            }
        ?>
    
    </table>
